﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Reap.Common.Runtime.Dependency {
	/// <summary>
	/// 依赖特性标记
	/// </summary>
	[AttributeUsage(AttributeTargets.Class,AllowMultiple = true)]
	public class DependencyAttribute:Attribute {
		public DependencyAttribute(ComponentLifeStyle lifeStyle = ComponentLifeStyle.Transient)
		{
			this.LifeStyle = lifeStyle;
		}

		public DependencyAttribute(Type serviceType, ComponentLifeStyle lifeStyle = ComponentLifeStyle.Transient)
		{
			this.ServiceType = serviceType;
			this.LifeStyle = lifeStyle;
		}
		#region Properties
		/// <summary>
		/// 服务类型
		/// </summary>
		public  Type ServiceType { get; protected set; }
		/// <summary>
		/// 生命周期
		/// </summary>
		public ComponentLifeStyle LifeStyle { get; protected set; }
		/// <summary>
		/// 关键字
		/// </summary>
		public  string Key { get; set; }
		/// <summary>
		/// 配置
		/// </summary>
		public  string Configuration { get; set; }
		/// <summary>
		/// 排序
		/// </summary>
		public  int Order { get; set; }
		#endregion
	}
}
